home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / mxlibs / smixw122 / smixw122.doc < prev    next >
Encoding:
Text File  |  1995-05-27  |  6.5 KB  |  134 lines

  1.           _____      __    __     ____     __   __       _     _
  2.          /  _  \    |  \  /  |   |    |   |  \ /  |     | |   | |
  3.         |  / \__|   |   \/   |    |  |     \  ~  /      | |   | |
  4.         |  \___     |        |    |  |      |   |       | |   | |
  5.          \___  \    |  /\/\  |    |  |      |   |       | | _ | |
  6.          __  \  |   |  |  |  |    |  |      |   |       | |/ \| |
  7.         |  \_/  |   |  |  |  |    |  |     /  ^  \      |   _   |
  8.          \_____/    |__|  |__|   |____|   |__/ \__|     \__/ \__/
  9.  
  10.                   for Watcom C DOS/4GW protected mode
  11.  
  12.                               Version 1.22
  13.                    Written by Ethan Brodsky (5/27/95)
  14.          Copyright 1995 by Ethan Brodsky.  All rights reserved.
  15.  
  16. This library is distributed AS IS.  The author specifically disclaims
  17. responsibility for any loss of profit or any consequential, incidental,
  18. or other damages.  SMIXW is freeware and is distributed with full source
  19. code, which is copyright by Ethan Brodsky.  You are free to incorporate
  20. the code in full or part into your own programs as long as credit is
  21. given to Ethan Brodsky.  The source code may be distributed in its
  22. original form only, including this documentation and the copyright
  23. notices.
  24.  
  25. ------------------------------------------------------------------------
  26.  
  27. You may have used my SBVOX and SBDSP units.  They both played one VOC
  28. file at a time.  The whole VOC file had to be loaded into conventional
  29. memory, taking valuable memory from a real mode program.
  30.  
  31. SMIXW will play up to 8 simultaneous sounds on a Sound Blaster or
  32. compatible in protected mode.  The sounds are stored anywhere in memory
  33. and are mixed into a small buffer as needed.  It uses auto initialized
  34. DMA if a SBPro or higher is installed, eliminating clicks between
  35. blocks. On a SB16 is installed, it will use 16-bit sound output,
  36. increasing the sound quality.  Full source for Watcom C protected mode
  37. using the DOS/4GW extender is included.
  38.  
  39. The sounds are stored on disk as raw signed 8-bit sample data at a
  40. sampling rate of 22050 HZ and are loaded anywhere in memory.  The
  41. data is mixed into a 16-bit buffer one block at a time, then copied
  42. down to an 8 or 16 bit buffer in conventional memory for DMA output.
  43.  
  44. Please test this on your setup (Especially if you have a Sound Blaster
  45. compatible or a configuration out of the ordinary) and report any
  46. incompatibilities to me.  I have personally tested this version on my
  47. SB16 and SBPro, but I have received reports that it works on many SB
  48. compatibles.
  49.  
  50. As the block size is increased, the sound latency will also increase.
  51. New sound effects are only started at the beginning of each block,
  52. so a block size of 512 gives a latency of about 1/43 of a second.
  53. This is the maximum time that can pass between when the StartSound
  54. procedure is called and when the sound starts playing.  In case you are
  55. wondering about the three counters displayed by the test program, the
  56. first one counts in the CPU's free time, the second counts the number
  57. of interrupts that have occurred, and the third is the number of sounds
  58. currently being played.  If you have an incompatibility problem, please
  59. tell me what each counter is doing.
  60.  
  61. SMIXW uses a raw 8-bit unsigned file format.  I have included a program
  62. that will convert WAV files to the raw format necessary.  The WAV files
  63. must be 8-bit and sampled at 22050 HZ, or the output will be distorted.
  64.  
  65. One important pointer:  The SMIX module MUST be compiled using the "-zu"
  66. compiler switch.  The Watcom code generator erroneously assumes that
  67. SS == DS when generating code for an interrupt handler.  The compiler
  68. then uses EBP to address data in DS and your program will terminate
  69. with a stack fault upon the first sound interrupt.  "-zu" tells the
  70. compiler not to make this assumption and is the best workaround for
  71. this compiler bug.  (Another option is to disable optimizations, but
  72. then the compiler will generate terrible code)  Due to the DOS/4GW
  73. extender used for Watcom C protected mode, sound cards on IRQ10 are
  74. not supported by this version of SMIX.
  75.  
  76. I have several improvements planned, but I need feedback.  If you are
  77. using my code, I would greatly appreciate it if you would mail me and
  78. tell me about it.  If you have any bug reports, suggestions, or have
  79. made improvements, please tell me!  I also have available a FM synthesis
  80. MIDI music library and am working on a digital music library, so tell me
  81. what you are interested in!
  82.  
  83. This library is freeware, but I would appreciate contributions so I can
  84. continue to buy development kits and upgrade my computer.  You don't
  85. NEED to send me anything, but if you are making money using this, please
  86. send whatever you feel that it is worth.
  87.  
  88. Features:
  89.   * Up to 8 sounds played simultaneously
  90.   * Sampling rate of 22050 HZ
  91.   * Autoinitialized DMA prevents clicking
  92.   * 16-bit sound output increases quality
  93.   * Mixes in the background using a fraction of CPU time
  94.   * Sound volume control supported
  95.  
  96. ------------------------------------------------------------------------
  97.  
  98. There are several ways to contact me:
  99.     E-Mail:  ericbrodsky@psl.wisc.edu (Preferred)
  100.     WWW:     http://www.xraylith.wisc.edu/~ebrodsky/
  101.     Phone:   (608) 238-4830
  102.     Mail:
  103.         Ethan Brodsky
  104.       4010 Cherokee Dr.
  105.       Madison, WI 53711
  106.  
  107. Bug fixes and other announcements will be posted in:
  108.     alt.sb.programmer
  109.     comp.sys.ibm.pc.soundcard.tech
  110.     rec.games.programmer
  111.  
  112. Up-to-date versions may be downloaded from:
  113.     x2ftp.oulu.fi /pub/msdos/programming/mxlibs/smixw*.zip
  114.       The directory structure at x2ftp is currently under reorganization
  115.       and the file will probably be moved to a different directory.
  116.     http://www.xraylith.wisc.edu/~ebrodsky/smix/smix.html
  117.  
  118. Revision history:
  119.  1.11 - Initial release
  120.  1.20 - Switched to a new mixing algorithm that doesn't reduce sound
  121.         volume on 8-bit sound cards.  Added support for sound volume
  122.         control.  Fixed a problem with output on Sound BlasterPros.
  123.         Optimized mixing code.  Modified code in exit procedure to
  124.         reset sound card on termination.
  125.  1.21 - Modifed shutdown code
  126.  1.22 - Fixed a detection problem with sound cards on DMA0.  Commented
  127.         SMIX interface.  Modified interrrupt acknowledgement.  Added a
  128.         sound_playing function to check if a sound is still playing.
  129.  
  130. I've been looking to get in with a commercial software company.  If any
  131. companies are interested, write to me at the above address.  Thanks!
  132.  
  133.     Ethan Brodsky
  134.